package com.yakisoft.jublish;

import org.junit.Test;
import static org.junit.Assert.*;

public class GlobMatchTest {
	@Test
	public void testCharacters() {
		GlobMatch match = new GlobMatch();
		assertTrue(match.match("abcd", "abcd"));
		assertFalse(match.match("abcd", "abcde"));
		assertFalse(match.match("bcde", "abcde"));

		assertTrue(match.match("x", "?"));
		assertTrue(match.match("abcd", "*"));

		assertTrue(match.match("abcd", "ab*"));
		assertTrue(match.match("abcdedfg", "ab*fg"));
		assertTrue(match.match("abcdefg", "*cd*"));

		assertTrue(match.match("cdefg", "cdefg*"));
		assertTrue(match.match("ABCD", "abcd"));

		assertTrue(match.match("/home/tony/myfile.txt", "*.txt"));
	}
}
